from tool_class.tools import generate_random_string

""" 验证资源组新增编辑 """
channel_add_001 = {
    "button_click.新增分类": {
        "testId":"baseSetting-channel-left-10001",
        },
    "input.名称": {
        "testId":"baseSetting-channel-form-10001",
        "value": generate_random_string(10),
        },
    "button_click.确定": {
        "text": "确定",
    },
    "get_list_data.数据集列表": {
        "testId": "baseSetting-channel-left-10002",
    },
}

channel_edit_001 = {
    "input.编辑名称": {
        "testId": "baseSetting-channel-form-10002",
        "value": generate_random_string(10),
    },
    "input.名称": {
        "testId":"baseSetting-channel-form-10001",
        "value": generate_random_string(10),
        },
    "button_click.确定": {
        "text": "确定",
    },
    "get_list_data.数据集列表": {
        "testId": "baseSetting-channel-left-10002",
    },
}

""" 新增二级分类 """
channel_add_002 = {
    "button_click.新增分类": {
        "testId":"baseSetting-channel-left-10001",
        },
    "input.名称": {
        "testId":"baseSetting-channel-form-10001",
        "value": generate_random_string(10),
        },
    "button_click.确定": {
        "text": "确定",
    }
}

""" 验证分类新增 """
class_add_001 = {
    "button_click.新增分类": {
        "testId":"baseSetting-channel-r-10001",
        },
    "input.名称": {
        "testId":"baseSetting-channel-form-10001",
        "value": generate_random_string(10),
        },
    "button_click.确定": {
        "text": "确定",
    },
    "get_list_data.数据集列表": {
        "testId": "baseSetting-channel-r-t1",
    },
}

""" 编辑分类 """
class_edit_001 = {
    "action_bar.编辑分类名称": {
        "testId":"baseSetting-channel-r-t3",
        "text":class_add_001['input.名称']["value"]
        },
    "input.名称": {
        "testId":"baseSetting-channel-form-10001",
        "value": generate_random_string(10),
        },
    "button_click.确定": {
        "text": "确定",
    },
    "get_list_data.数据集列表": {
        "testId": "baseSetting-channel-r-t1",
    },
}

class_edit_002 = {
    "action_bar.编辑分类状态-禁用": {
        "testId":"baseSetting-channel-r-t3",
        "text":class_add_001['input.名称']["value"]
        },
    "radio_select.编辑状态": {
        "testId":"baseSetting-channel-form-10004",
        "radio_vaules": "禁用",
        },
    "button_click.确定": {
        "text": "确定",
    },
    "get_list_data.数据集列表": {
        "testId": "baseSetting-channel-r-t2-2",
    },
}

class_edit_003 = {
    "action_bar.编辑分类状态-启用": {
        "testId":"baseSetting-channel-r-t3",
        "text":class_add_001['input.名称']["value"]
        },
    "radio_select.编辑状态": {
        "testId":"baseSetting-channel-form-10004",
        "radio_vaules": "启用",
        },
    "button_click.确定": {
        "text": "确定",
    },
    "get_list_data.数据集列表": {
        "testId": "baseSetting-channel-r-t2-2",
    },
}

""" 验证必填项 """
required_fields_001 = {
    "button_click.请输入分类名称": {
        "testId":"baseSetting-channel-left-10001",
        },
    "button_click.确定": {
        "text": "确定",
    }
}
required_fields_002 = {
    "button_click.请输入渠道名称": {
        "testId":"baseSetting-channel-r-10001",
        },
    "button_click.确定": {
        "text": "确定",
    }
}

""" 验证字段长度 """
length_01 = {
    "button_click.新增分类": {
        "testId": "baseSetting-channel-left-10001",
    },
    "input.分类名称_10":{
        "testId": "baseSetting-channel-form-10001",
        "value": generate_random_string(11),
    }
}
length_02 = {
    "button_click.新增分类": {
        "testId": "baseSetting-channel-left-10001",
    },
    "input.英文名称_20":{
        "testId": "baseSetting-channel-form-10002",
        "value": generate_random_string(21),
    }
}
length_03 = {
    "button_click.新增渠道": {
        "testId": "baseSetting-channel-r-10001",
    },
    "input.渠道名称_10":{
        "testId": "baseSetting-channel-form-10001",
        "value": generate_random_string(11),
    }
}
length_04 = {
    "button_click.新增渠道": {
        "testId": "baseSetting-channel-r-10001",
    },
    "input.渠道名称_20":{
        "testId": "baseSetting-channel-form-10002",
        "value": generate_random_string(21),
    }
}

""" 查询项目列表 """
project_query_01 = {
    "pull_checked.启用状态": {
        "testId":"projectList-1002",
        "liId" : "projectList-1002-op-0"
        },
    "button_click.查询": {
        "testId": "projectList-1005",
    },
    "get_list_data.标签类型列表": {
        "testId":"projectList-2001-t5",
        }
}
project_query_02 = {
    "input.匹配项目名称": {
        "testId":"projectList-1003",
        "value" : "长城测试"
        },
    "button_click.查询": {
        "testId": "projectList-1005",
    },
    "get_list_data.标签类型列表": {
        "testId":"projectList-2001-t0",
        }
}
project_query_03 = {
    "input.不匹配项目名称": {
        "testId":"projectList-1003",
        "value" : "不匹配项目名称"
        },
    "button_click.查询": {
        "testId": "projectList-1005",
    },
    "get_list_data.标签类型列表": {
        "testId":"projectList-2001-t0",
        }
}